exports.removeAggregationApiDocsCategory = function (req, res) {

    //获取参数信息
    var bodyParams = req.routeInfo.bodyParams;

    //任务流创建
    async.waterfall([

        //判断该分类下是否有接口
        (cb) => {

            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.bussinessApiDocsSearch.Request_Api_Url + "/bad_badcid/" + bodyParams.badcid,
                    method : 'GET'
                },
                function (data) {

                    if(data.result.data.length > 0){
                        return RES.errorResponse("抱歉，该分类下存在接口，请先删除接口，在删除分类信息");
                    }

                    cb()
                
                }
            )
        },

        //删除接口分类信息
        (cb) => {

            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.bussinessApiDocsCategoryDelete.Request_Api_Url,
                    method : 'POST',
                    data : {
                        delete_where : "badc_id",
                        badc_id      : bodyParams.badcid,
                        isPhysicallyDelete : 1
                    }
                },
                function (data) {

                    cb()
                
                }
            )
        }
      
    ],()=>{

        //返回最终拼接结果
        RES.successResponse();

    });


}